$(document).ready(function(){
	if (cms24k.living()) {
		$('.signup').click(function(){
			
			
			var this_ = this;
			var day = $("#day").val();
			var month = $("#month").val();
			var year = $("#year").val();
			var birthday;
			var datas =  $("#signup-form").serializeArray();
			if (day && month && year ){
				var d = new Date(year, month-1, day);
				 var yyyy = d.getFullYear().toString();                                    
			     var mm = (d.getMonth()+1).toString(); // getMonth() is zero-based         
			     var dd  = d.getDate().toString(); 
			     var result  = yyyy + '-' + (mm[1]?mm:"0"+mm[0]) + '-' + (dd[1]?dd:"0"+dd[0])
				datas.push( {name : 'birthday',
							value : result});
  			}
 			var submit = {
					url : '/pub-member/signup/',
					type : "POST",
					dataType : "json",
					data  : datas,
					success : function(data) {
						if (data && data.state && (data.state.indexOf("ERROR") != -1)) {
							alert (data.message);
							reloadcapcha();
							return;
						} else {
							reloadcapcha();
							alert ('thanks for your enquiry');
					//		$(this_).attr('disabled','disabled');
							
						}
					}
				};
				$.ajax(submit);
		});
	}
	});